include('shared.lua')

SWEP.PrintName          = "Stargate GDO"
SWEP.Slot               = 5
SWEP.Slotpos            = 1
SWEP.Drawammo           = false
SWEP.Drawcrosshair      = false

CreateClientConVar("cl_weapon_gdo_iriscode", 0, true, true)

//thanks to brwarner for this
function ShowIrisMenu()
	local panel = vgui.Create("Frame")
	panel:SetSize(300, 100)
	panel:SetPos((ScrW()/2 - 350) / 2, ScrH()/2 - 75)
	panel:SetVisible(true)
	panel:MakePopup()
	panel:PostMessage( "SetTitle", "text", "Set Iris Transmitter Code")
	
	local text = vgui.Create( "TextEntry", panel)
	text:SetText(LocalPlayer():GetInfo("cl_weapon_gdo_iriscode"))
	text:SetPos( 30, 30)
	text:SetSize(200, 30)	

	local button = vgui.Create("Button", panel)
	button:SetText("Save Code")
	button:SetPos(30, 70)
	
	function button:DoClick()
		LocalPlayer():ConCommand("cl_weapon_gdo_iriscode " .. text:GetValue() .. "\n")
		panel:Remove()
	end
end

concommand.Add("gdo_openpanel", ShowIrisMenu)